﻿using System;

namespace Program2
{
    class Program2
    {
        static void Main(string[] args)
        {
            int[] a= { 1, 3, 5, 7, 9, 2, 4, 6, 8, 10 };
            Console.WriteLine("The max, min, average, and sum of a are: " + findMax(a) + " " + findMin(a) + " " + average(a) + " and " + sum(a));
        }
        static int findMax(int[] p)
        {
            int max=p[0];
            for(int i = 0; i < p.Length; i++)
            {
                if (max < p[i]) { max = p[i]; }
            }
            return max;
        }
        static int findMin(int[] p)
        {
            int min = p[0];
            for (int i = 0; i < p.Length; i++)
            {
                if (min > p[i]) { min = p[i]; }
            }
            return min;
        }
        static double average(int[] p)
        {
            double avg = p[0];
            avg = sum(p) / p.Length;
            return avg;
        }
        static int sum(int[] p)
        {
            int sum = 0;
            for (int i = 0; i < p.Length; i++)
            {
                sum += p[i];
            }
            return sum;
        }
    }
}
